<!doctype html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <title>auxclick demo</title>
  <style>
    html {
      height: 100%;
      overflow: hidden;
    }

    body {
      height: inherit;
      display: flex;
      justify-content: center;
      align-items: center;
      margin: 0;
    }

    button {
      border: 0;
      background-color: white;
      font-size: 10vw;
      display: block;
      width: 100%;
      height: 100%;
    }

    button {
      letter-spacing: 1rem;
    }
  </style>
</head>

<body>

  <button>Click me!</button>


  <script>

  const button = document.querySelector('button');
  const html = document.querySelector('html');

  function random(number) {
    return Math.floor(Math.random() * number);
  }

  button.onclick = () => {
    const rndCol = `rgb(${random(255)}, ${random(255)}, ${random(255)})`;
    button.style.backgroundColor = rndCol;
  };

  button.onauxclick = (e) => {
    e.preventDefault();
    const rndCol = `rgb(${random(255)}, ${random(255)}, ${random(255)})`;
    button.style.color = rndCol;
  }

  </script>


</body>

</html>
